<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="i1" placeholder="姓名">
<input id="i2" placeholder="工资">
<input id="i3" placeholder="工作">
<input type="button" value="添加" onclick="f()">
<table border="1px">
    <caption>员工列表</caption>
    <tr>
        <th>姓名</th>
        <th>工资</th>
        <th>工作</th>
    </tr>
</table>
<script>
    function f() {
        let tr = document.createElement("tr");
        let td1 = document.createElement("td");
        let td2 = document.createElement("td");
        let td3 = document.createElement("td");
        let table = document.querySelector("table");
        td1.innerText = i1.value;
        td2.innerText = i2.value;
        td3.innerText = i3.value;
        tr.append(td1, td2, td3);
        table.append(tr);
    }
</script>

</body>
</html>